#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <queue>

using namespace std;

int n, k;
typedef long long LL;

int main()
{
    priority_queue<LL> heap;

    cin >> n >> k;

    LL x, sum = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> x;

        if (x % 2 == 0)
            heap.push(x);
        else
            sum += x;
    }
    //     cout << "sum : " << sum << endl;

    while (!heap.empty() && k > 0)
    {
        //cout << "sum1 : " << sum << endl;


        sum += heap.top();
        LL num = heap.top() / 2;
        heap.pop();

        if (k > 0)
        {

            k--;
            sum -= num;

            if (num % 2 == 0)
            {
                heap.push(num);
                //sum -= num;
            }
        }
        //cout << "sum2 : " << sum << endl;

    }

    cout << sum << endl;
    return 0;

}